package com.lagou.executor;

import com.lagou.pojo.Configuration;
import com.lagou.pojo.MappedStatement;

import java.sql.SQLException;
import java.util.List;

/**
 * @ClassName: Excutor
 * @Auther: Jerry
 * @Date: 2020/6/20 9:43
 * @Desctiption: TODO
 * @Version: 1.0
 */
public interface Executor {

    <E> List<E> query(Configuration configuration, MappedStatement mappedStatement, Object... params) throws Exception;

    Integer insert(Configuration configuration, MappedStatement mappedStatement, Object... params) throws ClassNotFoundException, SQLException, IllegalAccessException, NoSuchFieldException, InstantiationException;

    Integer update(Configuration configuration, MappedStatement mappedStatement, Object... params) throws ClassNotFoundException, SQLException, IllegalAccessException, NoSuchFieldException, InstantiationException;

    void commit() throws SQLException;

    void close() throws SQLException;

    void rollback() throws SQLException;
}
